package com.ygxsk.carhome.ui.leads;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.NetworkUtils;
import com.blankj.utilcode.util.RegexUtils;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.flyco.roundview.RoundLinearLayout;
import com.flyco.roundview.RoundTextView;
import com.gyf.immersionbar.ImmersionBar;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BasePopupView;
import com.trello.rxlifecycle4.android.ActivityEvent;
import com.ygxsk.carhome.R;
import com.ygxsk.carhome.alertview.AlertView;
import com.ygxsk.carhome.alertview.OnItemClickListener;
import com.ygxsk.carhome.constant.ConstantApi;
import com.ygxsk.carhome.constant.ConstantSign;
import com.ygxsk.carhome.constant.ExtraKey;
import com.ygxsk.carhome.constant.ExtraValue;
import com.ygxsk.carhome.enumwrap.LeadCarType;
import com.ygxsk.carhome.enumwrap.LeadGender;
import com.ygxsk.carhome.event.EventLeadDetail;
import com.ygxsk.carhome.event.EventLeadMain;
import com.ygxsk.carhome.greendao.CarBrandLargeCategoryDaoManager;
import com.ygxsk.carhome.greendao.CarBrandSeriesLineDaoManager;
import com.ygxsk.carhome.listener.DoSomeThingListener;
import com.ygxsk.carhome.listener.ErrorParentExtraSingle;
import com.ygxsk.carhome.listener.GainDataCallBackListener;
import com.ygxsk.carhome.listener.RxBus;
import com.ygxsk.carhome.response.CarBrandLargeCategory;
import com.ygxsk.carhome.response.CarBrandSeriesLineSmallCategory;
import com.ygxsk.carhome.response.LeadCarTypeBean;
import com.ygxsk.carhome.response.LeadDetailItemBean;
import com.ygxsk.carhome.response.LeadsGenderInfoBean;
import com.ygxsk.carhome.retrofit.AddLogUpLoadInfo;
import com.ygxsk.carhome.retrofit.ApiException;
import com.ygxsk.carhome.retrofit.ApiRequestSubListener;
import com.ygxsk.carhome.retrofit.ApiService;
import com.ygxsk.carhome.retrofit.ErrorConsumer;
import com.ygxsk.carhome.retrofit.NetworkManager;
import com.ygxsk.carhome.retrofit.ResponseTransformer;
import com.ygxsk.carhome.rxbus.RxBusCarBrand;
import com.ygxsk.carhome.rxbus.RxBusCarSeriesLineSmall;
import com.ygxsk.carhome.rxbus.RxBusCarType;
import com.ygxsk.carhome.rxbus.RxBusGender;
import com.ygxsk.carhome.ui.ErrorActivity;
import com.ygxsk.carhome.utils.CommUtils;
import com.ygxsk.carhome.views.ClearEditText;
import com.ygxsk.carhome.views.FJEditTextCountPublishSmall;
import com.ygxsk.integrated.retrofit.Parameterkey;

import org.greenrobot.eventbus.EventBus;

import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.concurrent.TimeUnit;

import butterknife.BindView;
import butterknife.OnClick;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Consumer;
import okhttp3.MediaType;
import okhttp3.RequestBody;

/*
 * @Author:itchenqi175@163.com
 * @Time:2023-07-11  16:25
 * @Description:潜客添加页面
 */
public class LeadAddSubmitActivity extends ErrorActivity implements ErrorParentExtraSingle {

    //旧车信息外侧包裹
    @BindView(R.id.roundlinearlayoutoldcarremarks)
    RoundLinearLayout roundLinearLayoutOldCarRemarks;

    //旧车信息的填充文本
    @BindView(R.id.textviecaroldoutedit)
    TextView textVieCarOldOutEdit;


    //提交按钮布局
    @BindView(R.id.layoutbuttonworksubmit)
    RoundTextView layoutButtOnWorkSubmit;

    //客户姓名
    @BindView(R.id.editviewnameemployee)
    ClearEditText editViewNameEmployee;

    //性别的内容外侧包裹
    @BindView(R.id.layoutleadforsex)
    LinearLayout layoutLeadForSex;

    //性别的文字描述
    @BindView(R.id.textviewleadforsex)
    TextView textViewLeadForSex;

    //电话信息
    @BindView(R.id.editviewphoneemployee)
    ClearEditText editViewPhoneEmployee;

    //微信号信息
    @BindView(R.id.editviewwechartemployee)
    ClearEditText editViewWeChartEmployee;

    //年龄信息
    @BindView(R.id.editviewinputleadyears)
    ClearEditText editViewInputLeadYears;

    //选择品牌
    @BindView(R.id.layoutleadbrand)
    LinearLayout layoutLeadBrand;

    //车辆品牌文字
    @BindView(R.id.textviewbrand)
    TextView textViewBrand;

    //选择品牌--车系
    @BindView(R.id.layoutleadbrandline)
    LinearLayout layoutleadBrandLine;

    //车辆--车系文字
    @BindView(R.id.textviewbrandline)
    TextView textViewBrandLine;

    //喜好车型
    @BindView(R.id.editviewinputleadcarmodel)
    ClearEditText editViewInputLeadCarModel;

//    //客户来源的外层；
//    @BindView(R.id.layoutleadformwherename)
//    LinearLayout layoutLeadFormWhereName;
//
//    //客户来源
//    @BindView(R.id.textvieweditviewformwherename)
//    TextView textViewEditViewFormWhereName;

    //车辆的类型
    @BindView(R.id.textvieweditviewforcartype)
    TextView textViewEditViewForCarType;

    //外层的跟进状态
//    @BindView(R.id.layoutfollowup)
//    LinearLayout layoutFollowUp;
//
//    //跟进状态
//    @BindView(R.id.textvieweditfollowup)
//    TextView textViewEditFollowUp;

    @BindView(R.id.editviewcontentpulishremark)
    FJEditTextCountPublishSmall editViewContentPulishRemark;

    //添加客户来源的 底部弹窗；
//    private BasePopupView basePopupView_formWhere;
    //车辆的类型
    private BasePopupView basePopupView_carType;
    //添加跟进状态的底部弹窗；
    private BasePopupView basePopupView_followUp;
    private BasePopupView basePopupViewGender;
    //弹窗的车辆品牌
    private BasePopupView basePopupView_carBrandLargeCategory;
    //选择车系的弹窗
    private BasePopupView basePopupView_carBrandSeriesSmallCategory;

    //性别的 弹窗列表
    private ArrayList<LeadsGenderInfoBean> mDataResources_genderType = new ArrayList<>();
    //一个临时的添加车辆 品牌列表
    private ArrayList<CarBrandLargeCategory> mDataResources_carBrandLarge = new ArrayList<>();
    //一个临时的车系内容
    private ArrayList<CarBrandSeriesLineSmallCategory> mDataResources_carBrandSeriesList = new ArrayList<>();

    //添加车辆类型的列表:新车或者二手车
    private ArrayList<LeadCarTypeBean> mDataResources_carType = new ArrayList<>();

    //一个临时的客户来源的列表；
//    private ArrayList<LeadFromWhereBean> mDataResources_formWhere = new ArrayList<>();
    //一个临时的客户信息状态跟进的列表
//    private ArrayList<LeadsFollowUpInfoBean> mDataResources_followUp = new ArrayList<>();

    //上传性别：性别：1男、2女、3保密
    private String memberSex_upLoad = "";
    //客户姓名
    private String customerName_upLoad = "";
    //客户的电话
    private String customerPhone_upLoad = "";
    //客户的微信号
    private String weChat_upLoad = "";
    //年龄
    private String ageNum_upLoad = "";
    //车辆品牌
    private String carBrandId_upLoad = "";
    //车辆品牌-车系
    private String carSeriesId_upLoad = "";

    //喜好车型-是车辆的最小型号单位
    private String vehicleName_upLoad = "";

    //车辆类型,类别:是新车或者是二手车
    private String latentType_upLoad = "";
    //备注信息
    private String remark_upLoad = "";

    //携带从 潜客详情-的整条数据
    private LeadDetailItemBean leadDetailItemBean_extraPass;


    @OnClick({R.id.layoutbuttonworksubmit, //保存按钮
            R.id.layoutleadforsex, //性别外侧包裹
            R.id.layoutleadbrand, //车辆品牌
            R.id.layoutleadbrandline, //车辆的这牌子的车系-车系
            R.id.layoutleadforcartype})//车辆类型是新车或者是二手车
    public void onViewClicked(View v) {
        switch (v.getId()) {
            case R.id.layoutbuttonworksubmit: {

                KeyboardUtils.hideSoftInput(mActivityInstance);

                // TODO: 2023-07-12 21:10 提交能力 二次弹窗确认；
                customerName_upLoad = editViewNameEmployee.getText().toString().trim();

                //校验姓名是必填项
                if (TextUtils.isEmpty(customerName_upLoad)) {
                    CommUtils.checkDialog(mAlertView);
                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, getString(R.string.check_customername_upload), true);
                    mAlertView.show();
                    return;
                }

                //2024年1月18日12:04:29 新增需求
                //如果客户姓名少于2个字符，也是不让通过的
                if (!TextUtils.isEmpty(customerName_upLoad) && (customerName_upLoad).length() < Parameterkey.keyWordLength) {
                    //ToastUtils.showShort("最少输入两个字符！");
                    CommUtils.checkDialog(mAlertView);
                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, StringUtils.getString(R.string.lead_add_person_name_length), true);
                    mAlertView.show();
                    return;
                }

                customerPhone_upLoad = editViewPhoneEmployee.getText().toString().trim();

                //----------------------------------------------------------------------------------------------------------------
                //客户电话不能为空
                if (TextUtils.isEmpty(customerPhone_upLoad)) {//
                    CommUtils.checkDialog(mAlertView);
                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, getString(R.string.check_customerphone_upload), true);
                    mAlertView.show();
                    return;
                }

                //对客户电话做校验
                //校验用户输入的手机号
                if (!RegexUtils.isMobileSimple(customerPhone_upLoad)) {
                    //CommUtils.displayToastShort(LoginActivity.this, "电话格式不对");
                    CommUtils.checkDialog(mAlertView);
                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, getString(R.string.check_customerphone_format), true);
                    mAlertView.show();
                    return;
                }

//                if (!RegexUtils.isMobileExact(customerPhone_upLoad)) {//精确验证手机号
//                    //CommUtils.displayToastShort(LoginActivity.this, "请输入有效手机号");
//                    CommUtils.checkDialog(mAlertView);
//                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, getString(R.string.check_customerphone_effective), true);
//                    mAlertView.show();
//                    return;
//                }
                //----------------------------------------------------------------------------------------------------------------


                if (TextUtils.isEmpty(latentType_upLoad)) {//车辆类型 是必填项 2023-8-24 18:14:55
                    CommUtils.checkDialog(mAlertView);
                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, getString(R.string.check_car_type_upload), true);
                    mAlertView.show();
                    return;
                }

                //只有一个单个点击
                CommUtils.checkDialog(mAlertView);
                mAlertView = new AlertView(StringUtils.getString(R.string.clearaddorsubmitsuretitletips), //提示
                        StringUtils.getString(R.string.clearaddorsubmitsuremessage),//提示内容
                        StringUtils.getString(R.string.clearcachecancel), //取消
                        new String[]{StringUtils.getString(R.string.clearaddorsubmitsure)},//确定
                        null, mActivityInstance, AlertView.Style.Alert, new OnItemClickListener() {//
                    @Override
                    public void onItemClick(Object o, int position) {

                        if (position != AlertView.CANCELPOSITION) {

                            if (flag_jumpfrom_where == ExtraValue.VALUE_JUMP_FORM_LEAD_ADD) {//【添加】

                                method_gainAddSubmitInfo_upLoad();

                            } else if (flag_jumpfrom_where == ExtraValue.VALUE_JUMP_FORM_LEAD_MODIFY) {//【修改】

                                method_gainModifyInfo_upLoad();

                            }

                        }
                    }
                });

                mAlertView.setCancelable(true);
                mAlertView.show();

                break;
            }

            case R.id.layoutleadforsex: {//性别弹窗；

                KeyboardUtils.hideSoftInput(mActivityInstance);

                LeadsGenderSelectPopu leadsGenderSelectPopu = new LeadsGenderSelectPopu(LeadAddSubmitActivity.this,//
                        ExtraValue.MODIFY_LEAD_GENDER_SELECT,//
                        mDataResources_genderType);

                leadsGenderSelectPopu.setTitleName(getResources().getString(R.string.choose_sex));

                //直接弹窗：
                basePopupViewGender = new XPopup.Builder(LeadAddSubmitActivity.this)
                        .hasShadowBg(true)
                        //.moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面
                        .isViewMode(true)
                        //.autoDismiss(false)
                        //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
                        .isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
                        //.dismissOnTouchOutside(true)
                        //.notDismissWhenTouchInView()
                        .moveUpToKeyboard(false)
                        .asCustom(leadsGenderSelectPopu)//
                        .show();

                break;
            }

            case R.id.layoutleadforcartype: {//车辆的类型，是新车或者二手车

                KeyboardUtils.hideSoftInput(mActivityInstance);

                //弹窗；
                if (mDataResources_carType != null && !mDataResources_carType.isEmpty()) {

                    LeadsCarTypeSelectPopu leadsCarTypeSelectPopu = new LeadsCarTypeSelectPopu(LeadAddSubmitActivity.this,//
                            ExtraValue.MODIFY_LEAD_CARTYPE_SELECT,//
                            mDataResources_carType);

                    leadsCarTypeSelectPopu.setTitleName(getResources().getString(R.string.choose_customer_cartype));

                    //直接弹窗：
                    basePopupView_carType = new XPopup.Builder(LeadAddSubmitActivity.this)
                            .hasShadowBg(true)
                            //.moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面;
                            .isViewMode(true)
                            //.autoDismiss(false)
                            //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
                            //.isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
                            //.dismissOnTouchOutside(true)
                            //.notDismissWhenTouchInView()
                            //.asCustom(new SelectViewCustomPopup(ExtraValue.RXBUS_WORKBOOK_STARTDATE_TO_ADDSUBMIT, ManagerCheckAddSubmitActivity.this))
                            //.moveUpToKeyboard(false)
                            .asCustom(leadsCarTypeSelectPopu)//
                            .show();

                }

                break;
            }

            case R.id.layoutleadbrand: {//车辆品牌

                //在它之前有没有必选的
                KeyboardUtils.hideSoftInput(mActivityInstance);

                //必须要先选择车辆的类型 是：新车或者是二手车，新车就调用新车的品牌，二手车就调用二手车的品牌
                if (TextUtils.isEmpty(latentType_upLoad)) {//车辆类型 是必填项 2023-8-24 18:14:55
                    CommUtils.checkDialog(mAlertView);
                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, getString(R.string.check_car_type_upload), true);
                    mAlertView.show();
                    return;
                }

                if (mDataResources_carBrandLarge != null && !mDataResources_carBrandLarge.isEmpty()) {

                    LeadsCarBrandLargeCategorySelectPopu leadsCarBrandLargeCategorySelectPopu = new LeadsCarBrandLargeCategorySelectPopu(LeadAddSubmitActivity.this,//
                            ExtraValue.MODIFY_LEAD_CARBRAND_SELECT,//
                            mDataResources_carBrandLarge);

                    leadsCarBrandLargeCategorySelectPopu.setTitleName(getResources().getString(R.string.car_evaluatebrand_choose));

                    //直接弹窗：
                    basePopupView_carBrandLargeCategory = new XPopup.Builder(LeadAddSubmitActivity.this)
                            .hasShadowBg(true)
                            .moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面;
                            .isViewMode(true)
                            //.autoDismiss(false)
                            //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
                            //.isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
                            //.dismissOnTouchOutside(true)
                            //.notDismissWhenTouchInView()
                            //.asCustom(new SelectViewCustomPopup(ExtraValue.RXBUS_WORKBOOK_STARTDATE_TO_ADDSUBMIT, ManagerCheckAddSubmitActivity.this))
                            //.moveUpToKeyboard(false)
                            .asCustom(leadsCarBrandLargeCategorySelectPopu)//
                            .show();

                } else {
                    //重新获取一遍接口；

                    gainCarBrandLargeCategory(new GainDataCallBackListener() {
                        @Override
                        public void doSomeThing() {

                            LeadsCarBrandLargeCategorySelectPopu leadsCarBrandLargeCategorySelectPopu = new LeadsCarBrandLargeCategorySelectPopu(LeadAddSubmitActivity.this,//
                                    ExtraValue.MODIFY_LEAD_CARBRAND_SELECT,//
                                    mDataResources_carBrandLarge);

                            leadsCarBrandLargeCategorySelectPopu.setTitleName(getResources().getString(R.string.car_evaluatebrand_choose));

                            //直接弹窗：
                            basePopupView_carBrandLargeCategory = new XPopup.Builder(LeadAddSubmitActivity.this)
                                    .hasShadowBg(true)
                                    //.moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面;
                                    .isViewMode(true)
                                    //.autoDismiss(false)
                                    //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
                                    //.isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
                                    //.dismissOnTouchOutside(true)
                                    //.notDismissWhenTouchInView()
                                    //.asCustom(new SelectViewCustomPopup(ExtraValue.RXBUS_WORKBOOK_STARTDATE_TO_ADDSUBMIT, ManagerCheckAddSubmitActivity.this))
                                    .moveUpToKeyboard(false)
                                    .asCustom(leadsCarBrandLargeCategorySelectPopu)//
                                    .show();

                        }
                    });

                }

                break;
            }

            case R.id.layoutleadbrandline: {//车辆品牌-车系

                KeyboardUtils.hideSoftInput(mActivityInstance);

                //如果车辆品牌是空，那么必须弹窗提示先选择车辆品牌
                if (TextUtils.isEmpty(carBrandId_upLoad) || TextUtils.isEmpty(textViewBrand.getText().toString().trim())) {
                    CommUtils.checkDialog(mAlertView);
                    mAlertView = CommUtils.method_showAlertViewSingleSlowly(mActivityInstance, ConstantSign.ALERT_TITLE, getString(R.string.chenck_carbrand_upLoad), true);
                    mAlertView.show();
                    return;
                }

                //必选车辆品牌；
                if (mDataResources_carBrandSeriesList != null && !mDataResources_carBrandSeriesList.isEmpty()) {

                    LeadsCarBrandSeriesLineSmalCategorySelectPopu leadsCarBrandSeriesLineSmalCategorySelectPopu = new LeadsCarBrandSeriesLineSmalCategorySelectPopu(LeadAddSubmitActivity.this,//
                            ExtraValue.MODIFY_LEAD_CARBRAND_SERIES_SELECT,//
                            mDataResources_carBrandSeriesList);

                    leadsCarBrandSeriesLineSmalCategorySelectPopu.setTitleName(getResources().getString(R.string.car_choose_car_line));

                    //直接弹窗：
                    basePopupView_carBrandSeriesSmallCategory = new XPopup.Builder(LeadAddSubmitActivity.this)
                            .hasShadowBg(true)
                            .moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面;
                            .isViewMode(true)
                            //.autoDismiss(false)
                            //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
                            //.isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
                            //.dismissOnTouchOutside(true)
                            //.notDismissWhenTouchInView()
                            //.asCustom(new SelectViewCustomPopup(ExtraValue.RXBUS_WORKBOOK_STARTDATE_TO_ADDSUBMIT, ManagerCheckAddSubmitActivity.this))
                            //.moveUpToKeyboard(false)
                            .asCustom(leadsCarBrandSeriesLineSmalCategorySelectPopu)//
                            .show();

                } else {
                    //重新获取一遍接口；

                    gainCarBrandSeriesLineSmallCategory(carBrandId_upLoad, new GainDataCallBackListener() {
                        @Override
                        public void doSomeThing() {

                            LeadsCarBrandSeriesLineSmalCategorySelectPopu leadsCarBrandSeriesLineSmalCategorySelectPopu = new LeadsCarBrandSeriesLineSmalCategorySelectPopu(LeadAddSubmitActivity.this,//
                                    ExtraValue.MODIFY_LEAD_CARBRAND_SERIES_SELECT,//
                                    mDataResources_carBrandSeriesList);

                            leadsCarBrandSeriesLineSmalCategorySelectPopu.setTitleName(getResources().getString(R.string.car_choose_car_line));

                            //直接弹窗：
                            basePopupView_carBrandSeriesSmallCategory = new XPopup.Builder(LeadAddSubmitActivity.this)
                                    .hasShadowBg(true)
                                    .moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面;
                                    .isViewMode(true)
                                    //.autoDismiss(false)
                                    //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
                                    //.isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
                                    //.dismissOnTouchOutside(true)
                                    //.notDismissWhenTouchInView()
                                    //.asCustom(new SelectViewCustomPopup(ExtraValue.RXBUS_WORKBOOK_STARTDATE_TO_ADDSUBMIT, ManagerCheckAddSubmitActivity.this))
                                    //.moveUpToKeyboard(false)
                                    .asCustom(leadsCarBrandSeriesLineSmalCategorySelectPopu)//
                                    .show();

                        }
                    }, true);

                }

                break;
            }


//            case R.id.layoutleadformwherename: {
//
//                //弹窗；
//                if (mDataResources_formWhere != null && !mDataResources_formWhere.isEmpty()) {
//
//                    //直接弹窗：
//                    basePopupView_formWhere = new XPopup.Builder(LeadAddSubmitActivity.this)
//                            .hasShadowBg(true)
//                            //.moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面;
//                            .isViewMode(true)
//                            //.autoDismiss(false)
//                            //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
//                            //.isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
//                            //.dismissOnTouchOutside(true)
//                            //.notDismissWhenTouchInView()
//                            //.asCustom(new SelectViewCustomPopup(ExtraValue.RXBUS_WORKBOOK_STARTDATE_TO_ADDSUBMIT, ManagerCheckAddSubmitActivity.this))
//                            //.moveUpToKeyboard(false)
//                            .asCustom(new LeadsFromWherePopu(LeadAddSubmitActivity.this,//
//                                    ExtraValue.VALUE_JUMP_FORM_LEADADDSUBMITACTIVITY,//
//                                    mDataResources_formWhere))//
//                            .show();
//
//                } else {
//                    //重新获取一遍接口；
//                }
//
//                break;
//            }

//            case R.id.layoutfollowup: {
//
//                //弹窗；
//                if (mDataResources_followUp != null && !mDataResources_followUp.isEmpty()) {
//
//                    //直接弹窗：
//                    basePopupView_followUp = new XPopup.Builder(LeadAddSubmitActivity.this)
//                            .hasShadowBg(true)
//                            //.moveUpToKeyboard(false) //如果不加这个，评论弹窗会移动到软键盘上面;
//                            .isViewMode(true)
//                            //.autoDismiss(false)
//                            //.isDestroyOnDismiss(true) //对于只使用一次的弹窗，推荐设置这个
//                            //.isThreeDrag(false) //是否开启三阶拖拽，如果设置enableDrag(false)则无效
//                            //.dismissOnTouchOutside(true)
//                            //.notDismissWhenTouchInView()
//                            //.asCustom(new SelectViewCustomPopup(ExtraValue.RXBUS_WORKBOOK_STARTDATE_TO_ADDSUBMIT, ManagerCheckAddSubmitActivity.this))
//                            //.moveUpToKeyboard(false)
//                            .asCustom(new LeadsFollowUpPopu(LeadAddSubmitActivity.this,//
//                                    ExtraValue.VALUE_JUMP_FORM_LEADADDSUBMITACTIVITY_FOLLOWUP,//添加跟进进度的标识；
//                                    mDataResources_followUp))//
//                            .show();
//
//                } else {
//
//                    //重新获取一遍接口；
//
//                }
//
//
//                break;
//            }

        }
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
//        activityLeadAddSubmitBinding = ActivityLeadAddSubmitBinding.inflate(getLayoutInflater());
        super.onCreate(savedInstanceState);

        mActivityInstance = this;

        processExtraData();

        if (mDataResources_carBrandLarge == null) {
            mDataResources_carBrandLarge = new ArrayList<>();
        }

        //该页面涉及到修改用户信息；
        initViews();

        //监听几个变动
        //监听性别变动
        mCompositeDisposable.add(RxBus.getInstance()//
                .toObserverable(RxBusGender.class)//
                .subscribeOn(AndroidSchedulers.mainThread())//
                .observeOn(AndroidSchedulers.mainThread())//
                .subscribe(new Consumer<RxBusGender>() {//
                    @Override
                    public void accept(RxBusGender rxBusGender) throws Exception {

                        int actionFlag = rxBusGender.getActionFlag();
                        LeadsGenderInfoBean leadsGenderInfoBean = rxBusGender.getLeadsGenderInfoBean();

                        if (actionFlag == ExtraValue.MODIFY_LEAD_GENDER_SELECT) {//更改了店铺信息和重新存储id等

                            memberSex_upLoad = leadsGenderInfoBean.getTypeId();

//                            LogUtils.d("itchen---mCompositeDisposable---切换性别-->" + leadsGenderInfoBean);
                            if (textViewLeadForSex != null) {
                                textViewLeadForSex.setText(leadsGenderInfoBean.getName());
                            }

                        }
                    }
                }));

        //监听车辆的类型 是新车或者是二手车
        mCompositeDisposable.add(RxBus.getInstance()//
                .toObserverable(RxBusCarType.class)//
                .subscribeOn(AndroidSchedulers.mainThread())//
                .observeOn(AndroidSchedulers.mainThread())//
                .subscribe(new Consumer<RxBusCarType>() {//
                    @Override
                    public void accept(RxBusCarType rxBusCarType) throws Exception {

                        int actionFlag = rxBusCarType.getActionFlag();
                        LeadCarTypeBean leadFromWhereBean = rxBusCarType.getLeadCarTypeBean();

                        if (actionFlag == ExtraValue.MODIFY_LEAD_CARTYPE_SELECT) {//更改了店铺信息和重新存储id等
//                            LogUtils.d("itchen---mCompositeDisposable---切换 客户的车辆的类型-是新车或者是二手车-->" + leadFromWhereBean);

                            //上传车辆类型的id
                            latentType_upLoad = leadFromWhereBean.getDictCode();

                            if (textViewEditViewForCarType != null) {
                                textViewEditViewForCarType.setText(leadFromWhereBean.getDictLabel());
                            }


//                            enum LeadCarType {
//                                LEADTYPE_CAR_NEW("1", "新车"),
//                                LEADTYPE_CAR_OLD("2", "二手车");

                            if (TextUtils.equals(latentType_upLoad, LeadCarType.LEADTYPE_CAR_NEW.getIndex())) {
                                //如果是新车：调用新车的车辆品牌

                                gainCarBrandLargeCategory(null);

                            } else if (TextUtils.equals(latentType_upLoad, LeadCarType.LEADTYPE_CAR_OLD.getIndex())) {

                                //如果是二手车:调用全部的车辆品牌
                                gainCarBrandListAll(null);

                            }

                            //-----------------------------------------
                            //清空车辆品牌和车系的已填充信息；
                            carBrandId_upLoad = "";
                            if (textViewBrand != null) {
                                textViewBrand.setText("");
                            }

                            carSeriesId_upLoad = "";
                            if (textViewBrandLine != null) {
                                textViewBrandLine.setText("");
                            }
                            //-----------------------------------------
                        }
                    }
                }));

        //监听品牌
        mCompositeDisposable.add(RxBus.getInstance()//
                .toObserverable(RxBusCarBrand.class)//
                .subscribeOn(AndroidSchedulers.mainThread())//
                .observeOn(AndroidSchedulers.mainThread())//
                .subscribe(new Consumer<RxBusCarBrand>() {//
                    @Override
                    public void accept(RxBusCarBrand rxBusCarBrand) throws Exception {

                        int actionFlag = rxBusCarBrand.getActionFlag();
                        CarBrandLargeCategory carBrandLargeCategory = rxBusCarBrand.getCarBrandLargeCategory();

                        if (actionFlag == ExtraValue.MODIFY_LEAD_CARBRAND_SELECT) {//更改了店铺信息和重新存储id等

                            if (carBrandLargeCategory != null) {

                                carBrandId_upLoad = carBrandLargeCategory.getCarBrandId();
//                                LogUtils.d("itchen---mCompositeDisposable---切换车辆品牌-->" + carBrandLargeCategory);

                                if (textViewBrand != null) {
                                    textViewBrand.setText(carBrandLargeCategory.getCarBrandName());
                                }

                                //----------------------------------------------------------------------------------------
                                //车辆品牌一旦切换，车系必须清空重置重新选择
                                carSeriesId_upLoad = "";
                                if (textViewBrandLine != null) {
                                    textViewBrandLine.setText("");
                                }

                                if (mDataResources_carBrandSeriesList != null && !mDataResources_carBrandSeriesList.isEmpty()) {
                                    mDataResources_carBrandSeriesList.clear();
                                }
                                //--------------------------------------------------------------------------------------------

                                gainCarBrandSeriesLineSmallCategory(carBrandId_upLoad, null, false);

                            }
                        }
                    }
                }));

        //监听车系
        mCompositeDisposable.add(RxBus.getInstance()//
                .toObserverable(RxBusCarSeriesLineSmall.class)//
                .subscribeOn(AndroidSchedulers.mainThread())//
                .observeOn(AndroidSchedulers.mainThread())//
                .subscribe(new Consumer<RxBusCarSeriesLineSmall>() {//
                    @Override
                    public void accept(RxBusCarSeriesLineSmall rxBusCarSeriesLineSmall) throws Exception {

                        int actionFlag = rxBusCarSeriesLineSmall.getActionFlag();
                        CarBrandSeriesLineSmallCategory carBrandSeriesLineSmallCategory = rxBusCarSeriesLineSmall.getCarBrandSeriesLineSmallCategory();

                        if (actionFlag == ExtraValue.MODIFY_LEAD_CARBRAND_SERIES_SELECT) {//更改了店铺信息和重新存储id等

                            if (carBrandSeriesLineSmallCategory != null) {

                                //车系的id信息；
                                carSeriesId_upLoad = carBrandSeriesLineSmallCategory.getCarSeriesId();

//                                LogUtils.d("itchen---mCompositeDisposable---切换车辆品牌-车系-->" + carBrandSeriesLineSmallCategory);

                                if (textViewBrandLine != null) {
                                    textViewBrandLine.setText(carBrandSeriesLineSmallCategory.getCarSeriesName());
                                }

                            }
                        }
                    }
                }));

        //


        //监听客户来源
//        mCompositeDisposable.add(RxBus.getInstance()//
//                .toObserverable(RxBusFromWhere.class)//
//                .subscribeOn(AndroidSchedulers.mainThread())//
//                .observeOn(AndroidSchedulers.mainThread())//
//                .subscribe(new Consumer<RxBusFromWhere>() {//
//                    @Override
//                    public void accept(RxBusFromWhere rxBusFromWhere) throws Exception {
//
//                        int actionFlag = rxBusFromWhere.getActionFlag();
//                        LeadFromWhereBean leadFromWhereBean = rxBusFromWhere.getLeadFromWhereBean();
//
//                        if (actionFlag == ExtraValue.MODIFY_LEAD_FROM_WHERE_SELECT) {//更改了店铺信息和重新存储id等
//
//                            LogUtils.d("itchen---mCompositeDisposable---切换 客户的来源渠道-->" + leadFromWhereBean);
//                            if (textViewEditViewFormWhereName != null) {
//                                textViewEditViewFormWhereName.setText(leadFromWhereBean.getDictLabel());
//                            }
//                        }
//                    }
//                }));


        //监听跟进状态
//        mCompositeDisposable.add(RxBus.getInstance()//
//                .toObserverable(RxBusFollowStep.class)//
//                .subscribeOn(AndroidSchedulers.mainThread())//
//                .observeOn(AndroidSchedulers.mainThread())//
//                .subscribe(new Consumer<RxBusFollowStep>() {//
//                    @Override
//                    public void accept(RxBusFollowStep rxBusFollowStep) throws Exception {
//
//                        int actionFlag = rxBusFollowStep.getActionFlag();
//                        LeadsFollowUpInfoBean leadsFollowUpInfoBean = rxBusFollowStep.getLeadsFollowUpInfoBean();
//
//                        if (actionFlag == ExtraValue.MODIFY_LEAD_FOLLOW_STEP_SELECT) {//更改了店铺信息和重新存储id等
//                            LogUtils.d("itchen---mCompositeDisposable---切换跟进状态-->" + leadsFollowUpInfoBean);
//
//                            if (textViewEditFollowUp != null) {
//                                textViewEditFollowUp.setText(leadsFollowUpInfoBean.getDictLabel());
//                            }
//
//                        }
//                    }
//                }));

        gainDatas();

    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();

        ImmersionBar.with(this)//
                .titleBar(R.id.toolbarygxskout)
                .fitsSystemWindows(true)//解决状态栏和布局重叠问题，任选其一，默认为false，当为true时一定要指定statusBarColor()，不然状态栏为透明色，还有一些重载方法
                //.statusBarColor(R.color.colorPrimary)//
                //.navigationBarColor(R.color.colorPrimary)//
                //.keyboardEnable(true)
                .init();
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_lead_add_submit;
    }

    @Override
    protected void initToolBar(ToolbarHelper toolbarHelper) {

        toolbarHelper.setTitle(getString(R.string.title_leadsaddsubmit));
        toolbarHelper.setVersionName(true, AppUtils.getAppVersionName());
        toolbarHelper.setLayoutClose(false, "", null);

        toolbarHelper.setLayoutLeft(true, R.drawable.backicon, new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                //搜索客户信息，优先关闭软键盘
                KeyboardUtils.hideSoftInput(mActivityInstance);

                methodBack();
            }
        });

        toolbarHelper.setLayoutRight(false, 0, "", null);

    }

    @Override
    protected void onClickNodata(View v) {

        //retain

    }

    @Override
    protected void initViews() {

        //编辑框的监听

        //编辑框监听

        //监听性别的列表
        //ArrayList<LeadsGenderInfoBean> leadsGenderInfoBeans = new ArrayList<>();

        //性别的列表信息
        LeadsGenderInfoBean leadsGenderInfoBeanMen = new LeadsGenderInfoBean();
        leadsGenderInfoBeanMen.setTypeId(LeadGender.LEAD_GENDER_MEN.getIndex());
        leadsGenderInfoBeanMen.setName(LeadGender.LEAD_GENDER_MEN.getValue());

        LeadsGenderInfoBean leadsGenderInfoBeanWoMen = new LeadsGenderInfoBean();
        leadsGenderInfoBeanWoMen.setTypeId(LeadGender.LEAD_GENDER_WOMEN.getIndex());
        leadsGenderInfoBeanWoMen.setName(LeadGender.LEAD_GENDER_WOMEN.getValue());

        LeadsGenderInfoBean leadsGenderInfoBeanUnKonw = new LeadsGenderInfoBean();
        leadsGenderInfoBeanUnKonw.setTypeId(LeadGender.LEAD_GENDER_UNKNOW.getIndex());
        leadsGenderInfoBeanUnKonw.setName(LeadGender.LEAD_GENDER_UNKNOW.getValue());

        mDataResources_genderType.add(leadsGenderInfoBeanMen);
        mDataResources_genderType.add(leadsGenderInfoBeanWoMen);
        mDataResources_genderType.add(leadsGenderInfoBeanUnKonw);

        //车辆类型
        LeadCarTypeBean leadCarTypeBeanNewCard = new LeadCarTypeBean();
        leadCarTypeBeanNewCard.setDictCode(LeadCarType.LEADTYPE_CAR_NEW.getIndex());
        leadCarTypeBeanNewCard.setDictLabel(LeadCarType.LEADTYPE_CAR_NEW.getValue());

        LeadCarTypeBean leadCarTypeBeanOldCar = new LeadCarTypeBean();
        leadCarTypeBeanOldCar.setDictCode(LeadCarType.LEADTYPE_CAR_OLD.getIndex());
        leadCarTypeBeanOldCar.setDictLabel(LeadCarType.LEADTYPE_CAR_OLD.getValue());

        mDataResources_carType.add(leadCarTypeBeanNewCard);
        mDataResources_carType.add(leadCarTypeBeanOldCar);

//        //预约试驾
//        LeadFromWhereBean leadFromWhereBean = new LeadFromWhereBean();
//        leadFromWhereBean.setDictCode(LeadCarFromWhere.LEAD_FROM_BOOK_TEST_DRIVE.getIndex());
//        leadFromWhereBean.setDictLabel(LeadCarFromWhere.LEAD_FROM_BOOK_TEST_DRIVE.getValue());
//
//        //预约看车
//        LeadFromWhereBean leadFromWhereBean1 = new LeadFromWhereBean();
//        leadFromWhereBean1.setDictCode(LeadCarFromWhere.LEAD_FROM_BOOK_LOOK_CAR.getIndex());
//        leadFromWhereBean1.setDictLabel(LeadCarFromWhere.LEAD_FROM_BOOK_LOOK_CAR.getValue());
//
//        //自然到店
//        LeadFromWhereBean leadFromWhereBean2 = new LeadFromWhereBean();
//        leadFromWhereBean2.setDictCode(LeadCarFromWhere.LEAD_FROM_NATURAL_TO_STORE.getIndex());
//        leadFromWhereBean2.setDictLabel(LeadCarFromWhere.LEAD_FROM_NATURAL_TO_STORE.getValue());
//
//        //以旧换新
//        LeadFromWhereBean leadFromWhereBean3 = new LeadFromWhereBean();
//        leadFromWhereBean3.setDictCode(LeadCarFromWhere.LEAD_FROM_OLD_TO_NEW.getIndex());
//        leadFromWhereBean3.setDictLabel(LeadCarFromWhere.LEAD_FROM_OLD_TO_NEW.getValue());
//
//        mDataResources_formWhere.add(leadFromWhereBean);
//        mDataResources_formWhere.add(leadFromWhereBean1);
//        mDataResources_formWhere.add(leadFromWhereBean2);
//        mDataResources_formWhere.add(leadFromWhereBean3);


        //跟进状态的列表信息
        //代码勿删将来用到

//        LeadsFollowUpInfoBean nomalCustomBean = new LeadsFollowUpInfoBean();
//        nomalCustomBean.setDictCode(LeadCarStepStatus.LEAD_STEP_TO_BE_CONTACT.getIndex());
//        nomalCustomBean.setDictLabel(LeadCarStepStatus.LEAD_STEP_TO_BE_CONTACT.getValue());
//
//        //1初步接洽
//        LeadsFollowUpInfoBean nomalCustomBean1 = new LeadsFollowUpInfoBean();
//        nomalCustomBean1.setDictCode(LeadCarStepStatus.LEAD_STEP_TO_INIT_CONTACT.getIndex());
//        nomalCustomBean1.setDictLabel(LeadCarStepStatus.LEAD_STEP_TO_INIT_CONTACT.getValue());
//
//        //2有意向
//        LeadsFollowUpInfoBean nomalCustomBean2 = new LeadsFollowUpInfoBean();
//        nomalCustomBean2.setDictCode(LeadCarStepStatus.LEAD_STEP_HAS_A_INTENT.getIndex());
//        nomalCustomBean2.setDictLabel(LeadCarStepStatus.LEAD_STEP_HAS_A_INTENT.getValue());
//
//        //3无意向
//        LeadsFollowUpInfoBean nomalCustomBean3 = new LeadsFollowUpInfoBean();
//        nomalCustomBean3.setDictCode(LeadCarStepStatus.LEAD_STEP_HAS_NO_INTENT.getIndex());
//        nomalCustomBean3.setDictLabel(LeadCarStepStatus.LEAD_STEP_HAS_NO_INTENT.getValue());
//
//        //4成功
//        LeadsFollowUpInfoBean nomalCustomBean4 = new LeadsFollowUpInfoBean();
//        nomalCustomBean4.setDictCode(LeadCarStepStatus.LEAD_STEP_SUCCESS.getIndex());
//        nomalCustomBean4.setDictLabel(LeadCarStepStatus.LEAD_STEP_SUCCESS.getValue());
//
//        //5战败
//        LeadsFollowUpInfoBean nomalCustomBean5 = new LeadsFollowUpInfoBean();
//        nomalCustomBean5.setDictCode(LeadCarStepStatus.LEAD_STEP_FAIL.getIndex());
//        nomalCustomBean5.setDictLabel(LeadCarStepStatus.LEAD_STEP_FAIL.getValue());
//
//        //6取消预约
//        LeadsFollowUpInfoBean nomalCustomBean6 = new LeadsFollowUpInfoBean();
//        nomalCustomBean6.setDictCode(LeadCarStepStatus.LEAD_STEP_CANCEL_BOOKING.getIndex());
//        nomalCustomBean6.setDictLabel(LeadCarStepStatus.LEAD_STEP_CANCEL_BOOKING.getValue());
//
//        mDataResources_followUp.add(nomalCustomBean);
//        mDataResources_followUp.add(nomalCustomBean2);
//        mDataResources_followUp.add(nomalCustomBean3);
//        mDataResources_followUp.add(nomalCustomBean4);
//        mDataResources_followUp.add(nomalCustomBean5);
//        mDataResources_followUp.add(nomalCustomBean6);

        //监听如果是从【编辑】过来的，要填充 edittext信息；
        if (leadDetailItemBean_extraPass != null) {

            LogUtils.d(ConstantSign.LOGCAT_NOMAL + "是编辑 潜客过来的");

            //如果是旧车信息，就展示旧车信息在顶部，如果是新车依然隐藏旧车包裹信息
            String latentType = leadDetailItemBean_extraPass.getLatentType();

//            public enum LeadCarType {
//                LEADTYPE_CAR_NEW("1", "新车"),
//                LEADTYPE_CAR_OLD("2", "二手车");

            if (TextUtils.equals(latentType, LeadCarType.LEADTYPE_CAR_OLD.getIndex())) {

                LogUtils.d(ConstantSign.LOGCAT_NOMAL + "是编辑 潜客过来的--旧车类型");
                CommUtils.setViewVisible(roundLinearLayoutOldCarRemarks);

                //展示二手车的具体信息
                if (textVieCarOldOutEdit != null) {
                    textVieCarOldOutEdit.setText(leadDetailItemBean_extraPass.getOldCarRemark());
                }

            } else if (TextUtils.equals(latentType, LeadCarType.LEADTYPE_CAR_NEW.getIndex())) {

                LogUtils.d(ConstantSign.LOGCAT_NOMAL + "是编辑 潜客过来的--新车类型");
                CommUtils.setViewGone(roundLinearLayoutOldCarRemarks);

            }

            //姓名
            customerName_upLoad = leadDetailItemBean_extraPass.getCustomerName();
            editViewNameEmployee.setText(leadDetailItemBean_extraPass.getCustomerName());

            //电话
            customerPhone_upLoad = leadDetailItemBean_extraPass.getCustomerPhone();
            editViewPhoneEmployee.setText(leadDetailItemBean_extraPass.getCustomerPhone());

            //性别
            String genderType = leadDetailItemBean_extraPass.getMemberSex();
            if (TextUtils.equals(genderType, LeadGender.LEAD_GENDER_MEN.getIndex())) {
                CommUtils.setText(textViewLeadForSex, LeadGender.LEAD_GENDER_MEN.getValue());
            } else if (TextUtils.equals(genderType, LeadGender.LEAD_GENDER_WOMEN.getIndex())) {
                CommUtils.setText(textViewLeadForSex, LeadGender.LEAD_GENDER_WOMEN.getValue());
            } else if (TextUtils.equals(genderType, LeadGender.LEAD_GENDER_UNKNOW.getIndex())) {
                CommUtils.setText(textViewLeadForSex, LeadGender.LEAD_GENDER_UNKNOW.getValue());
            }

            //微信号
            editViewWeChartEmployee.setText(leadDetailItemBean_extraPass.getWeChat());

            //年龄
            editViewInputLeadYears.setText(leadDetailItemBean_extraPass.getAgeNum());

            //车辆类型
            textViewEditViewForCarType.setText(leadDetailItemBean_extraPass.getLatentTypeName());

            //车辆品牌
            textViewBrand.setText(leadDetailItemBean_extraPass.getCarBrandName());

            //车辆车系
            textViewBrandLine.setText(leadDetailItemBean_extraPass.getCarSeriesName());

            //喜好车型
            editViewInputLeadCarModel.setText(leadDetailItemBean_extraPass.getVehicleName());

            //备注信息
            editViewContentPulishRemark.setText(leadDetailItemBean_extraPass.getRemark());

        } else {

            //是【添加潜客】过来的，那么车主旧车信息隐藏
            CommUtils.setViewGone(roundLinearLayoutOldCarRemarks);

        }

        //一个帮助布局的高度
        CommUtils.methodHelpView((TextView) findViewById(R.id.textviewhelpinleadformwhere));


    }

    @Override
    protected void gainDatas() {

        if (NetworkUtils.isConnected()) {

            if (flag_jumpfrom_where == ExtraValue.VALUE_JUMP_FORM_LEAD_ADD) {

                //获取车辆的品牌信息
                gainCarBrandLargeCategory(null);

            } else if (flag_jumpfrom_where == ExtraValue.VALUE_JUMP_FORM_LEAD_MODIFY) {

                //如果是【编辑】过来的，一定要根据携带的  车辆品牌-获取车系，
                gainCarBrandListAll(null);

                //获取车辆的车系信息
                gainCarBrandSeriesLineSmallCategory(carBrandId_upLoad, null, false);

            }

        } else {

            //retain
            ToastUtils.showShort(getString(R.string.http_exception_network));

        }

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

//        if (basePopupView_formWhere != null) {
//            basePopupView_formWhere.onDestroy();
//            basePopupView_formWhere = null;
//        }

        if (basePopupView_followUp != null) {
            basePopupView_followUp.onDestroy();
            basePopupView_followUp = null;
        }

        if (basePopupViewGender != null) {
            basePopupViewGender.onDestroy();
            basePopupViewGender = null;
        }

        if (basePopupView_carType != null) {
            basePopupView_carType.onDestroy();
            basePopupView_carType = null;
        }

        if (basePopupView_carBrandLargeCategory != null) {
            basePopupView_carBrandLargeCategory.onDestroy();
            basePopupView_carBrandLargeCategory = null;
        }

        if (basePopupView_carBrandSeriesSmallCategory != null) {
            basePopupView_carBrandSeriesSmallCategory.onDestroy();
            basePopupView_carBrandSeriesSmallCategory = null;
        }

    }

    @Override
    protected void methodBack() {

        if (ActivityUtils.isActivityAlive(this)) {
            ActivityUtils.finishActivity(this);
        }

    }

    //获取车辆的品牌--大范畴--是获取新车的车辆品牌，主要是这个门店的【新车】
    private void gainCarBrandLargeCategory(GainDataCallBackListener _gainDataCallBackListener) {

        //
        HashMap<String, Object> map = new HashMap<>();
        //map.put(Parameterkey., yourName);

        AddLogUpLoadInfo addLogUpLoadInfo = new AddLogUpLoadInfo();
        addLogUpLoadInfo.setActivity(mActivityInstance);
        addLogUpLoadInfo.setWhat(ConstantApi.WHAT_GETCARBRANDFORVEHICLEPAGE);//请求数字标识
        addLogUpLoadInfo.setUrlPath(ApiService.getCarBrandForVehiclePage_url);//url地址
        addLogUpLoadInfo.setRequestMethod(ConstantSign.REQUEST_METHOD_POST);//POST 或者 GET
        addLogUpLoadInfo.setToastToUser(true);//展示给用户的标志
        addLogUpLoadInfo.setHashMapParameter(map);

        NetworkManager.getInstance().initRetrofitRxJava()
                .create(ApiService.class)
                .getCarBrandForVehiclePage(RequestBody.create(JSON.toJSONString(map, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue),
                        MediaType.parse(ApiService.HEADER_JSON)))
                .compose(LeadAddSubmitActivity.this.bindUntilEvent(ActivityEvent.DESTROY))
                .compose(new ResponseTransformer<>(addLogUpLoadInfo, new ApiRequestSubListener<ArrayList<CarBrandLargeCategory>>() {
                    @Override
                    public void handlerSomeThingNotSuccessDataForItSelf(int what_method, String serverCode, String serverMessage) {
                        super.handlerSomeThingNotSuccessDataForItSelf(what_method, serverCode, serverMessage);
                    }
                })).doOnSubscribe(new Consumer<Disposable>() {
                    @Override
                    public void accept(Disposable disposable) throws Throwable {

                        //清理车辆品牌数据库内容
                        CarBrandLargeCategoryDaoManager.getInstance().deleteAllCarBrand();
                        method_create_materialDialog(mActivityInstance, ConstantSign.TIPS_LOADING);

                    }
                }).subscribe(new Consumer<ArrayList<CarBrandLargeCategory>>() {
                    @Override
                    public void accept(ArrayList<CarBrandLargeCategory> carBrandLargeCategories) throws Throwable {

                        if (mDataResources_carBrandLarge != null && !mDataResources_carBrandLarge.isEmpty()) {
                            mDataResources_carBrandLarge.clear();
                        }

                        if (carBrandLargeCategories != null && !carBrandLargeCategories.isEmpty()) {
                            if (mDataResources_carBrandLarge != null) {
                                mDataResources_carBrandLarge.addAll(carBrandLargeCategories);
                                //先排序
//                                CommUtils.CollectionsSort_CarBrandLargeCategory_UK(mDataResources_carBrandLarge);
                                CommUtils.CollectionsSort_CarBrandLargeCategory_CHINA(mDataResources_carBrandLarge);
                                //填充车辆品牌的数据
                                CarBrandLargeCategoryDaoManager.getInstance().insertMultCarBrand(mDataResources_carBrandLarge);
                            }
                        }

                        CommUtils.checkMaterialDialog(materialDialog);

                        //立即获取车系？没有必要
                        if (_gainDataCallBackListener != null) {
                            _gainDataCallBackListener.doSomeThing();
                        }

                    }
                }, new ErrorConsumer() {

                    @Override
                    protected void error(ApiException apiException) {
                        CommUtils.checkMaterialDialog(materialDialog);
                    }
                });

    }

    //获取车辆的全部 品牌，包括二手车，涉及到 二手车的预约看车，信息提交
    private void gainCarBrandListAll(GainDataCallBackListener _gainDataCallBackListener) {

        HashMap<String, Object> map = new HashMap<>();
        //map.put(Parameterkey., yourName);

        AddLogUpLoadInfo addLogUpLoadInfo = new AddLogUpLoadInfo();
        addLogUpLoadInfo.setActivity(mActivityInstance);
        addLogUpLoadInfo.setWhat(ConstantApi.WHAT_GETCARBRANDLIST_URL);//请求数字标识
        addLogUpLoadInfo.setUrlPath(ApiService.getCarBrandList_url);//url地址
        addLogUpLoadInfo.setRequestMethod(ConstantSign.REQUEST_METHOD_POST);//POST 或者 GET
        addLogUpLoadInfo.setToastToUser(true);//展示给用户的标志
        addLogUpLoadInfo.setHashMapParameter(map);

        NetworkManager.getInstance().initRetrofitRxJava()
                .create(ApiService.class)
                .getCarBrandList(RequestBody.create(JSON.toJSONString(map, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue),
                        MediaType.parse(ApiService.HEADER_JSON)))
                .compose(LeadAddSubmitActivity.this.bindUntilEvent(ActivityEvent.DESTROY))
                .compose(new ResponseTransformer<>(addLogUpLoadInfo, new ApiRequestSubListener<ArrayList<CarBrandLargeCategory>>() {
                    @Override
                    public void handlerSomeThingNotSuccessDataForItSelf(int what_method, String serverCode, String serverMessage) {
                        super.handlerSomeThingNotSuccessDataForItSelf(what_method, serverCode, serverMessage);
                    }
                })).doOnSubscribe(new Consumer<Disposable>() {
                    @Override
                    public void accept(Disposable disposable) throws Throwable {

                        method_create_materialDialog(mActivityInstance, ConstantSign.TIPS_LOADING);

                    }
                }).subscribe(new Consumer<ArrayList<CarBrandLargeCategory>>() {
                    @Override
                    public void accept(ArrayList<CarBrandLargeCategory> carBrandLargeCategories) throws Throwable {

                        if (mDataResources_carBrandLarge != null && !mDataResources_carBrandLarge.isEmpty()) {
                            mDataResources_carBrandLarge.clear();
                        }

                        if (carBrandLargeCategories != null && !carBrandLargeCategories.isEmpty()) {
                            if (mDataResources_carBrandLarge != null) {
                                mDataResources_carBrandLarge.addAll(carBrandLargeCategories);
                            }
                        }

                        //---------------------------------------------------------------------------------------------
                        //设置一个【品牌】的选中；
                        if (mDataResources_carBrandLarge != null && !mDataResources_carBrandLarge.isEmpty()) {

                            //---------------------------------------------------------------------------------------------
                            //先排序
                            Collections.sort(mDataResources_carBrandLarge, new Comparator<CarBrandLargeCategory>() {
                                public int compare(CarBrandLargeCategory o1, CarBrandLargeCategory o2) {
                                    String s1 = o1.getCarBrandName();
                                    String s2 = o2.getCarBrandName();
                                    //该排序为正序排序，如果倒序排序则将compare中的s2和s1互换位置
                                    return Collator.getInstance(Locale.UK).compare(s1, s2);
                                }
                            });
                            //---------------------------------------------------------------------------------------------

                            if (leadDetailItemBean_extraPass != null) {

                                carBrandId_upLoad = leadDetailItemBean_extraPass.getCarBrandId();

                                Iterator<CarBrandLargeCategory> iterator = mDataResources_carBrandLarge.iterator();

                                if (iterator != null) {
                                    while (iterator.hasNext()) {
                                        CarBrandLargeCategory item = iterator.next();
                                        if (item != null) {

                                            if (TextUtils.equals(carBrandId_upLoad, item.getCarBrandId())) {

                                                item.setChecked(true);

                                                LogUtils.json(ConstantSign.LOGCAT_NOMAL + "过滤选中的数据是--item-->", item);

//                                                {
//                                                        "carBrandId": "5",
//                                                        "carBrandName": "大众",
//                                                        "logoImg": "http://222.222.17.184:8990/resource/car_brand/1690701997916_135.png",
//                                                        "sortCode": "5"
//                                                }

                                            } else {

                                                item.setChecked(false);

                                            }
                                        }
                                    }
                                }
                            }
                        }

                        //---------------------------------------------------------------------------------------------
                        CommUtils.checkMaterialDialog(materialDialog);

                        //立即获取车系？没有必要
                        if (_gainDataCallBackListener != null) {
                            _gainDataCallBackListener.doSomeThing();
                        }

                    }
                }, new ErrorConsumer() {

                    @Override
                    protected void error(ApiException apiException) {
                        CommUtils.checkMaterialDialog(materialDialog);
                        function_apiException(apiException);
                    }
                });

    }

    /**
     * 获取车辆的车系--小范畴，
     *
     * @param _carBrandId
     * @param _gainDataCallBackListener
     */
    private void gainCarBrandSeriesLineSmallCategory(String _carBrandId, GainDataCallBackListener _gainDataCallBackListener, boolean isAlertToUserDialog) {

        //
        HashMap<String, Object> map = new HashMap<>();
        map.put(Parameterkey.carBrandId, _carBrandId);

        AddLogUpLoadInfo addLogUpLoadInfo = new AddLogUpLoadInfo();
        addLogUpLoadInfo.setActivity(mActivityInstance);
        addLogUpLoadInfo.setWhat(ConstantApi.WHAT_GETCARSERIESLIST);//请求数字标识
        addLogUpLoadInfo.setUrlPath(ApiService.getCarSeriesList_url);//url地址
        addLogUpLoadInfo.setRequestMethod(ConstantSign.REQUEST_METHOD_POST);//POST 或者 GET
        addLogUpLoadInfo.setToastToUser(false);//展示给用户的标志
        addLogUpLoadInfo.setAlertToUser(true);
        addLogUpLoadInfo.setHashMapParameter(map);

        NetworkManager.getInstance().initRetrofitRxJava()
                .create(ApiService.class)
                .getCarSeriesList(RequestBody.create(JSON.toJSONString(map, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue),
                        MediaType.parse(ApiService.HEADER_JSON)))
                .compose(LeadAddSubmitActivity.this.bindUntilEvent(ActivityEvent.DESTROY))
                .compose(new ResponseTransformer<>(addLogUpLoadInfo, new ApiRequestSubListener<ArrayList<CarBrandSeriesLineSmallCategory>>() {
                    @Override
                    public void handlerSomeThingNotSuccessDataForItSelf(int what_method, String serverCode, String serverMessage) {
                        super.handlerSomeThingNotSuccessDataForItSelf(what_method, serverCode, serverMessage);

                        CommUtils.checkMaterialDialog(materialDialog);

                        //{"data":"","message":"无数据","code":"20002"}
//                        if (!TextUtils.isEmpty(serverMessage)) {
//                            ToastUtils.showShort(serverMessage);
//                        }

                        if (isAlertToUserDialog) {
                            function_response_20002(serverCode, serverMessage, addLogUpLoadInfo, false);
                        }

                    }
                })).doOnSubscribe(new Consumer<Disposable>() {
                    @Override
                    public void accept(Disposable disposable) throws Throwable {

                        //清空
                        CarBrandSeriesLineDaoManager.getInstance().deleteAllCarSeries();

                        if (_gainDataCallBackListener != null) {
                            method_create_materialDialog(mActivityInstance, ConstantSign.TIPS_LOADING);
                        }

                    }
                }).subscribe(new Consumer<ArrayList<CarBrandSeriesLineSmallCategory>>() {
                    @Override
                    public void accept(ArrayList<CarBrandSeriesLineSmallCategory> carBrandSeriesLineSmallCategories) throws Throwable {

                        CommUtils.checkMaterialDialog(materialDialog);

                        if (mDataResources_carBrandSeriesList != null && !mDataResources_carBrandSeriesList.isEmpty()) {
                            mDataResources_carBrandSeriesList.clear();
                        }

                        if (carBrandSeriesLineSmallCategories != null && !carBrandSeriesLineSmallCategories.isEmpty()) {

                            if (mDataResources_carBrandSeriesList != null) {

                                mDataResources_carBrandSeriesList.addAll(carBrandSeriesLineSmallCategories);

                                //---------------------------------------------------------------------------------------------------
                                //对车系 进行排序
                                Collections.sort(mDataResources_carBrandSeriesList, new Comparator<CarBrandSeriesLineSmallCategory>() {
                                    public int compare(CarBrandSeriesLineSmallCategory o1, CarBrandSeriesLineSmallCategory o2) {
                                        String s1 = o1.getCarSeriesName();
                                        String s2 = o2.getCarSeriesName();
                                        //该排序为正序排序，如果倒序排序则将compare中的s2和s1互换位置
                                        return Collator.getInstance(Locale.UK).compare(s1, s2);
                                    }
                                });
                                //---------------------------------------------------------------------------------------------------

                                //filldatas
                                CarBrandSeriesLineDaoManager.getInstance().insertMultCarSeries(mDataResources_carBrandSeriesList);

                            }
                        }

                        if (_gainDataCallBackListener != null) {
                            _gainDataCallBackListener.doSomeThing();
                        }

                    }
                }, new ErrorConsumer() {

                    @Override
                    protected void error(ApiException apiException) {
                        CommUtils.checkMaterialDialog(materialDialog);
                    }
                });

    }

    //【新增添加潜客】执行上传操作
    private void method_gainAddSubmitInfo_upLoad() {

        //年龄信息
        ageNum_upLoad = editViewInputLeadYears.getText().toString().trim();
        //微信号信息
        weChat_upLoad = editViewWeChartEmployee.getText().toString().trim();
        //喜好的车型
        vehicleName_upLoad = editViewInputLeadCarModel.getText().toString().trim();
        //备注信息
        remark_upLoad = editViewContentPulishRemark.getText().toString().trim();

        HashMap<String, Object> map = new HashMap<>();
        map.put(Parameterkey.shopInfoId, mSession.getShopInfoId());//店铺id
        map.put(Parameterkey.latentType, latentType_upLoad);//类别：1新车；2二手车
        map.put(Parameterkey.customerName, customerName_upLoad);//姓名是必填项
        map.put(Parameterkey.customerPhone, customerPhone_upLoad);//客户手机号是必填
        map.put(Parameterkey.ageNum, ageNum_upLoad);//客户年龄
        map.put(Parameterkey.memberSex, memberSex_upLoad);//性别信息
        map.put(Parameterkey.weChat, weChat_upLoad);//微信号
        map.put(Parameterkey.carBrandId, carBrandId_upLoad);//车辆品牌的id
        map.put(Parameterkey.carSeriesId, carSeriesId_upLoad);//车辆品牌-车系的id
        map.put(Parameterkey.vehicleName, vehicleName_upLoad);//喜好的车型,添加获取车型的文本
        map.put(Parameterkey.remark, remark_upLoad);//备注信息

        AddLogUpLoadInfo addLogUpLoadInfo = new AddLogUpLoadInfo();
        addLogUpLoadInfo.setActivity(mActivityInstance);
        addLogUpLoadInfo.setWhat(ConstantApi.WHAT_ADDLATENTCUSTOMER);//请求数字标识
        addLogUpLoadInfo.setUrlPath(ApiService.addLatentCustomer_url);//url地址
        addLogUpLoadInfo.setRequestMethod(ConstantSign.REQUEST_METHOD_POST);//POST 或者 GET
        addLogUpLoadInfo.setToastToUser(true);//展示给用户的标志
        addLogUpLoadInfo.setHashMapParameter(map);

        NetworkManager.getInstance().initRetrofitRxJava()
                .create(ApiService.class)
                .addLatentCustomer(RequestBody.create(JSON.toJSONString(map, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue),
                        MediaType.parse(ApiService.HEADER_JSON)))
                .compose(LeadAddSubmitActivity.this.bindUntilEvent(ActivityEvent.DESTROY))
                .compose(new ResponseTransformer<>(addLogUpLoadInfo, new ApiRequestSubListener<String>() {
                    @Override
                    public void handlerSomeThingNotSuccessDataForItSelf(int what_method, String serverCode, String serverMessage) {
                        super.handlerSomeThingNotSuccessDataForItSelf(what_method, serverCode, serverMessage);
                        CommUtils.checkMaterialDialog(materialDialog);
                    }
                })).doOnSubscribe(new Consumer<Disposable>() {
                    @Override
                    public void accept(Disposable disposable) throws Throwable {
                        method_create_materialDialog(mActivityInstance, ConstantSign.TIPS_SUBMIT);
                    }
                }).subscribe(new Consumer<String>() {
                    @Override
                    public void accept(String stringValue) throws Throwable {

                        CommUtils.checkMaterialDialog(materialDialog);

                        //TipDialog.show(StringUtils.getString(R.string.add_submit_success), WaitDialog.TYPE.SUCCESS);

                        //通知主页列表刷新
                        EventLeadMain eventLeadMain = new EventLeadMain();
                        eventLeadMain.setMessage(ExtraValue.EVENTBUS_EVENT_TO_REFRESH_LEADMAINLIST);
                        EventBus.getDefault().post(eventLeadMain);

                        //该页面关闭，
                        //提示提交成功，然后1秒后关闭界面
                        CommUtils.checkDialog(mAlertView);
                        mAlertView = new AlertView(StringUtils.getString(R.string.clearaddorsubmitsuretitletips), //
                                getString(R.string.add_submit_success), //
                                null, //
                                null, //
                                null, //
                                LeadAddSubmitActivity.this, //
                                AlertView.Style.Alert, //
                                null);
                        mAlertView.setCancelable(true).show();//

                        mCompositeDisposable.add(Observable.timer(ConstantApi.ALERTVIEW_TIME_DELAY, TimeUnit.MILLISECONDS)
                                .subscribeOn(AndroidSchedulers.mainThread())//
                                .observeOn(AndroidSchedulers.mainThread())//
                                .compose(LeadAddSubmitActivity.this.bindUntilEvent(ActivityEvent.DESTROY))//
                                .subscribe(new Consumer<Long>() {
                                    @Override
                                    public void accept(Long aLong) throws Exception {

                                        if (mAlertView != null) {
                                            if (mAlertView.isShowing()) {
                                                mAlertView.dismiss();
                                                mAlertView = null;
                                            }
                                        }

                                        methodBack();

                                    }
                                }));

                    }
                }, new ErrorConsumer() {

                    @Override
                    protected void error(ApiException apiException) {

                    }
                });

    }

    //【编辑已有潜客】执行上传修改操作
    private void method_gainModifyInfo_upLoad() {

//        {
//                "latentCustomerId": 142, //潜客主键ID
//                "customerName": "李试1", //姓名
//                "customerPhone": "15888888888", //电话
//                "ageNum": 0, //年龄
//                "memberSex": "", //性别：1男、2女、3保密
//                "weChat": "", //微信号
//                "carBrandId": 10, //车牌ID
//                "carSeriesId": 5, //车系ID
//                "vehicleName": "测试车型号", //车型名称
//                "remark": "" //备注
//        }

        //年龄信息
        ageNum_upLoad = editViewInputLeadYears.getText().toString().trim();
        //微信号信息
        weChat_upLoad = editViewWeChartEmployee.getText().toString().trim();
        //喜好的车型
        vehicleName_upLoad = editViewInputLeadCarModel.getText().toString().trim();
        //备注信息
        remark_upLoad = editViewContentPulishRemark.getText().toString().trim();

        HashMap<String, Object> map = new HashMap<>();
        //这个特殊，需要添加这一条【潜客记录】的id
        map.put(Parameterkey.latentCustomerId, leadDetailItemBean_extraPass.getLatentCustomerId());//这条潜客的信息；

        map.put(Parameterkey.shopInfoId, mSession.getShopInfoId());//店铺id
        map.put(Parameterkey.latentType, latentType_upLoad);//类别：1新车；2二手车
        map.put(Parameterkey.customerName, customerName_upLoad);//姓名是必填项
        map.put(Parameterkey.customerPhone, customerPhone_upLoad);//客户手机号是必填
        map.put(Parameterkey.ageNum, ageNum_upLoad);//客户年龄
        map.put(Parameterkey.memberSex, memberSex_upLoad);//性别信息
        map.put(Parameterkey.weChat, weChat_upLoad);//微信号
        map.put(Parameterkey.carBrandId, carBrandId_upLoad);//车辆品牌的id
        map.put(Parameterkey.carSeriesId, carSeriesId_upLoad);//车辆品牌-车系的id
        map.put(Parameterkey.vehicleName, vehicleName_upLoad);//喜好的车型,添加获取车型的文本
        map.put(Parameterkey.remark, remark_upLoad);//备注信息

        AddLogUpLoadInfo addLogUpLoadInfo = new AddLogUpLoadInfo();
        addLogUpLoadInfo.setActivity(mActivityInstance);
        addLogUpLoadInfo.setWhat(ConstantApi.WHAT_UPDATELATENTCUSTOMER_URL);//请求数字标识
        addLogUpLoadInfo.setUrlPath(ApiService.updateLatentCustomer_url);//url地址
        addLogUpLoadInfo.setRequestMethod(ConstantSign.REQUEST_METHOD_POST);//POST 或者 GET
        addLogUpLoadInfo.setToastToUser(true);//展示给用户的标志
        addLogUpLoadInfo.setHashMapParameter(map);

        NetworkManager.getInstance().initRetrofitRxJava()
                .create(ApiService.class)
                .updateLatentCustomer(RequestBody.create(JSON.toJSONString(map, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue),
                        MediaType.parse(ApiService.HEADER_JSON)))
                .compose(LeadAddSubmitActivity.this.bindUntilEvent(ActivityEvent.DESTROY))
                .compose(new ResponseTransformer<>(addLogUpLoadInfo, new ApiRequestSubListener<String>() {
                    @Override
                    public void handlerSomeThingNotSuccessDataForItSelf(int what_method, String serverCode, String serverMessage) {
                        super.handlerSomeThingNotSuccessDataForItSelf(what_method, serverCode, serverMessage);
                        CommUtils.checkMaterialDialog(materialDialog);
                    }
                })).doOnSubscribe(new Consumer<Disposable>() {
                    @Override
                    public void accept(Disposable disposable) throws Throwable {
                        method_create_materialDialog(mActivityInstance, ConstantSign.TIPS_SUBMIT);
                    }
                }).subscribe(new Consumer<String>() {
                    @Override
                    public void accept(String stringValue) throws Throwable {

                        CommUtils.checkMaterialDialog(materialDialog);

                        //TipDialog.show(StringUtils.getString(R.string.add_submit_success), WaitDialog.TYPE.SUCCESS);

                        //首先-通知详情页刷新
                        EventLeadDetail eventLeadDetail = new EventLeadDetail();
                        eventLeadDetail.setMessage(ExtraValue.EVENTBUS_EVENT_TO_REFRESH_LEAD_DETAIL);
                        EventBus.getDefault().post(eventLeadDetail);

                        //通知主页列表刷新
                        EventLeadMain eventLeadMain = new EventLeadMain();
                        eventLeadMain.setMessage(ExtraValue.EVENTBUS_EVENT_TO_REFRESH_LEADMAINLIST);
                        EventBus.getDefault().post(eventLeadMain);

                        //该页面关闭，
                        //提示提交成功，然后1秒后关闭界面
                        methodSubmitSuccess(LeadAddSubmitActivity.this, new DoSomeThingListener() {
                            @Override
                            public void doSomeThing() {
                                methodBack();
                            }
                        });

                    }
                }, new ErrorConsumer() {

                    @Override
                    protected void error(ApiException apiException) {

                        function_apiException(apiException);

                    }
                });


    }

    @Override
    public void processExtraData() {

        Bundle extras_bundle = this.getIntent().getExtras();

        if (extras_bundle != null) {

            //标志 是 添加 潜客 或者 是修改潜客 信息
            flag_jumpfrom_where = extras_bundle.getInt(ExtraKey.EXTRA_JUMPFROM_WHERE);

            leadDetailItemBean_extraPass = extras_bundle.getParcelable(ExtraKey.EXTRA_LEAD_DETAIL_ITEM_BEAN);

            //如果是【编辑】过来的，将携带的数据赋值，并且填充textview或者editview
            if (leadDetailItemBean_extraPass != null) {

                //车辆类型
                latentType_upLoad = leadDetailItemBean_extraPass.getLatentType();
                //车辆品牌
                carBrandId_upLoad = leadDetailItemBean_extraPass.getCarBrandId();
                //车辆车系
                carSeriesId_upLoad = leadDetailItemBean_extraPass.getCarSeriesId();
                //员工性别
                memberSex_upLoad = leadDetailItemBean_extraPass.getMemberSex();

                LogUtils.json(ConstantSign.LOGCAT_NOMAL + "这是详情携带的数据--leadDetailItemBean_extraPass", leadDetailItemBean_extraPass);

            }

        }

    }
}